<template>
    <div class="home-container">
        Home组件 <br>
        <a href="#" @click="gotoMovie(99999)">编程式导航</a>
        <hr>
        <son ref="mySon" />
    </div>
</template>

<script setup>
import { ref,onMounted } from 'vue'
import  {useRoute,useRouter}from 'vue-router'
import son from './son.vue';

const  router =useRouter()
const abc =ref(8888)
function gotoMovie(id) {
    router.replace({ 
    name:'MovieDetails',
  params:{userId:id}
    }
    )
// router.go(2)
}
const mySon = ref(null)

onMounted(() => {
    console.log(mySon.value.demo);
    mySon.value.myfun()
})
</script>

<style  scoped>
.home-container {
    min-height: 150px;
    background-color: aqua;
    padding: 15px;
}
</style>